package com.lrs.java.j2se_advanced.classLoader;

public class TestLoadClass {
	
	public static void main(String [] args){
		System.out.println("main()...");
		Sandwich s = new Sandwich();
		//Sandwich ss = new Sandwich();
		//System.out.println(s);
	}	
	
}
class Meal {
	static AAAA a = new AAAA();
									
	public Meal(){
		System.out.println("Meal");
	}
}
class Bread {
	public Bread(){
		System.out.println("Bread");
	}
}
class Cheese {
	public Cheese(){
		System.out.println("Cheese");
	}
}
class Lettuse {
	public Lettuse(){
		System.out.println("Lettuse");
	}
}
class Lunch extends Meal {
	static AAA a = new AAA();
	public Lunch(){
		System.out.println("Lunch");
	}
}
class PortableLunch extends Lunch {
	static AA a = new AA();
	public PortableLunch(){
		System.out.println("PortableLunch");
	}
}
class Sandwich extends PortableLunch {
    //{
    //	bb = new B();
		//s="sadfasdf";
    //}
	//B bb ;
	//String s;
    //{
    //	System.out.println(bb);
    //	System.out.println(bb);
    //}
    
	static A a ;
	static {
		a = new A();
	}
	
	Bread b = new Bread();
	Cheese c = new Cheese();
	Lettuse l = new Lettuse();

	public Sandwich(){
		super();
		System.out.println("Sandwich");
	}
 
	//main方法放在这里与main方法放在public类中效果不一样。
	/*
	public static void main(String [] args){
		System.out.println("main()...");
		Sandwich s = new Sandwich();
		//Sandwich ss = new Sandwich();
		//System.out.println(s);
	}
	*/	
}

class A{
	A(){
		System.out.println("A()...");
	}
}
class AA{
	AA(){
		System.out.println("AA()...");
	}
}
class AAA{
	AAA(){
		System.out.println("AAA()...");
	}
}
class AAAA{
	AAAA(){
		System.out.println("AAAA()...");
	}
}

class B{
	B(){
		System.out.println("B()....");
	}
}